package com.qf.utils;

import com.qf.servlet.Admin;

import java.util.ArrayList;
import java.util.List;

public class DemoUtils {
    private static List<Admin> list = new ArrayList<>();


    public static void addAdmin(Admin admin){
        list.add(admin);
    }
    public static Admin querAdmin(String username, String password) {

        for (Admin admin : list) {
            if (admin.getUsername().equals(username) && admin.getPassword().equals(password)) {
                return admin;
            }
        }
        return null;
    }



}
